It all started with the discovery of flour. In ancient times, people would use the flour to make bread and cake alike. The only difference was that cake was sweet while bread was not. The name "cake" was sometimes interchangeable with the word "bread" because it was used to describe smaller breads. The "cake" from back then is not the conventional cake that we all know of today. It is the equivalent of today's oatcake (which looks more like a cookie or a biscuit).
Cakes were baked mostly for special occasions because they used the best ingredients that were available to cook. So like most desserts, the higher the social class, the higher the chances were of eating cake with a lot of frequency. But when baking ingredients and baking utensils became affordable and was mass-produced, the lower social classes were able to enjoy eating cake with much more frequency than they had in the past.
Now-a-days, cakes can be as elaborate or as simple as possible. It all depends on the occasion. Now you can go to a supermarket or grocery store and find different types of cakes or have one made the way you like. There are also bakeries that specialize in making cakes that range from traditional to artsy and elaborate.