I broadly agree, and certainly for staples and root crops, it blows my mind how cheap supermarkets can be. The amount of work, land, pesticides, fertilizers, seeds, etc. it takes to grow a few kilogram of carrots manually is insane compared to being able to buy at 50p/kg at the supermarket. That really shows the level of industrialisation and automation involved in large scale farming.
Which is why I focus on specific crops that I've identified as being valuable or useful to me.
Basil, of course, I already mentioned, and similar to basil is other green and leafy veg, such as spinach, mint, coriander, rocket, spring onions and cress. They grow so quickly and easily that I guess the majority of the cost in a supermarket is the packaging and logistics. I also grow a lot of soft fruits such as strawberries because supermarket fruits are expensive and bland tasting compared to a freshly picked ripe strawberry. Squashes are good to grow as they're quite prolific producers without much effort, yet fairly expensive to buy in the supermarket. Garlic, chilli, tomato, runner beans and leeks I grow mainly because I can choose the cultivars I like, and find they're tastier than the ones I can get in the supermarket.
Of course, the biggest input I'm obviously not accounting for is my time, but as it's an enjoyable hobby that's good for my physical and mental health, that doesn't factor in for me. Plus, I think it's a good life skill to know how to grow food, and it's interesting to try and do it in a sustainable way, e.g. permaculture, supporting pollinators, producing your own compost, propagating your own seeds, capturing and storing water onsite, etc.
I certainly wouldn't quit my job and become a farmer, but I do think growing some of your own food is something everyone should at least try once if they have the space. Also as a general rule, animals require a larger scale to make a profit than do vegetables.