What is the main cause of differences in the costs of living? Following question is not formulated in technical language of economics, since I am not an economist and I am mostly interested in accessible answers. Yet, I think it goes deeply into theory of economy and I hope it is not off-topic. 

In different regions of the world, costs of living are very different. For simplicity, let us consider two countries which use the same currency (for example euro). In country A, there are high salaries, high housing costs, high costs of services, while in country B, all these quantities are lower. If we compare how much haircuts or meals in restaurant can citizen of country A buy for his salary, the number might be similar to what citizen of country B can buy for his salary. The prices of commodities often do not differ that much, but they tend to differ as well. The quality of services is similar. My question is: What is in the core of the difference in costs of living? What causes them?

To clarify, I am not interested in answers like "country A is more developed", or "country A is more rich", since it doesn't explain the issue, it just gives it another name. I would like to understand the mechanism. I have two hypotheses, which might be the cause, but I am not able to judge which one is more true, or if they are correct at all.

Hypothesis 1: History. During creation of the common currency, there was some agreement how much the national currencies are worth. (Based on international trade and older history.) This set up the level of costs of living to some value. If there is not much trade and migration between country A and B, costs of living equilibrate only slowly.

Hypothesis 2: Transfer from other sectors. If there is some high technology and well paid industry in country A, employees of this industry can afford better services and can afford to offer more money for housing, which increases salaries of all people in services and possibly transfers to all sectors of society.
The United States has had a common currency for over two hundred years.  The cost of living in rural Georgia has not equalized with that in New York City during that time.  If anything, they've diverged.  

Land in New York City is more expensive than land in rural Georgia.  As a result, rent is more expensive in New York City.  This has a cascading effect.  Because residential rent is more expensive, wages need to be higher.  Because commercial rent and wages are higher, prices of products and services need to be higher.  Which makes wages need to be higher again.  

Note that commodities will often have very similar prices even in these conditions.  This is especially true of things that can be ordered from outside the region.  Even something like a haircut might be similar just because of economies of scale.  In New York City, there are more people needing haircuts, so a moderate price may still produce more revenue.  And of course, there are places that charge much more for a haircut.  

Theoretical differences can be caused by something as simple as preferences.  Or by history.  Or by a single industry.  Or by some combination of those.  For example, New York City has historically been a financial center and had the kind of night life that a large city can.  That's history, preference for an advanced night life, and a special industry.  The reasons in your hypothetical countries are also likely to be complicated and probably not entirely understood.  

In the end, the most we can say is that people are willing to pay more to live in New York City than rural Georgia.  If you went around and asked people in New York City, they might give a bunch of different reasons.  One person has always lived there.  Another came to work on Wall Street.  Another tried several places and just prefers it.  Someone else came to be on Broadway.  Unfortunately, it's unlikely that we can point to a single economic reason unless we pick something bland like, "because they could."  

Given two actual countries, we might be able to do a little better.  That's why I've been picking on the New York City/rural Georgia comparison.  That at least gives something to discuss.  The big point that I wanted to make is that your assumption that historical differences would disappear is incorrect.  Historical differences could persist.  Prices don't have to equalize in a common currency area.