How does hugo relate a .md file to a html layout file?

For future reference. Here is a thread for new docs feedback. Thanks @bep: