(And sometimes they do clearly vary from the recipe - like clearly not the called-for cheese, or without the described scattering of something over the top or whatever. Which I think's mostly fine or even good, but occasionally I think 'what do you mean by x' and either can't tell from the photo, or have to remind myself that that's only someone else's interpretation anyway.)
Here's my grandma's recipe for flapjacks ... accompanied by a picture of flapjacks ... the recipe I made up, the picture was from a stock photo site (best place to get pictures of gravy! /jk) ...
For me that revelation explains a lot.
Very likely this has changed but once there were specialized artists that made mock-ups (often using wax, but not only), besides the ready-made props (usually plastic).
And then there is an endless list of non-food ingredients that are used because they come out great in photography, example:
https://petapixel.com/2018/11/30/tricks-food-photographers-u...
I'm not saying that they don't also do fake food, but a lot of real food is used as well.