A cornerstone is literally a stone at the corner of a building. It’s an important stone, so it also means “the basic part of something,” as in, the cornerstone of the suffragette movement was getting women the right to vote.
When a building goes up, putting in the cornerstone is a big deal and people celebrate. Many cornerstones are engraved with historical information about the building, such as the year the building was built. The cornerstone is sometimes made of a different material from the rest of the building too. From the sense of "foundation," cornerstone also means "essential element.” If you’re really into Italian food, you might say that pasta is the cornerstone of your diet.