Medieval communities did not engage in capitalism or any sort of internal market economy. Your assumption is that history defaults to a modern western mindset where everyone is highly individualistic and only interested in themselves. Yes you would give your neighbor eggs because you know theyll give you nails. Its called a “gift economy” by historians. Anyone who didnt help the community would be ostracized
Commerce is not the same thing as capitalism, those words are not synonyms. Take a step back and open a dictionary. Pedantic definitions aside. The idea that capitalism is human nature and that human society and more broadly humans as a species are inherently capitalist is completely made up and ancient couns existing doesnt prove it. Id recommend looking up articles regarding “gift culture’” and “barter culture”
As for opening a history book: i did my undergrad in European history, and have a masters in Archeology. So while im not the definitive expert on the history of commerce and capitalism by any means, I have definitely opened up a couple history books.