There are three fundamental parts to the <locale> header.
Idiom? The following two variants are pretty much synonymous:
There are three parts to the header.
There are three parts in the header.
The reason for this is, pretty much, just because those are the constructions allowed by English. The use of in follows pretty closely the locative meaning of in. The use of to is licensed by a general English idiom "There is X to Y", meaning "Y consists of X."
However, I find the following to be slightly awkward:
There are three parts of the header.
I suspect that the reason is because we expect the trailing prepositional phrase to be a sentential prepositional phrase and not part of a noun phrase, and of is never used to head sentential prepositional phrases.
"to" is used to describe the result(in this case, theree parts combined and become resultant the header)
"in" is used to describe the decomposition of the structure.
due to sequence of arranging words,
the differences of first and second : the meaning of first is construction of header. the meaning of second is decomposition of the header.
similarity of 2 pharases : but 2 pharase commonly imply that three parts are essential ingredient of the header.
This use of "to" is a bit difficult to describe and to analyse. My typical example is from Hamlet: There is a lot more to the universe than we see. I think that's a variant of the original quote. I tend to fill in a verb form such as "belonging to" to have some way to make this use of "to" more understandable. If one wants to delimit this special use of "to" by analyzing what verbs or expressions may fit I think of
- to belong to, to appertain to, affiliaton.
This use of "to" overlaps with the idea of "part of something" and I would say it is convention that has fixed expressions where appertaining to something is expressed with "to" instead of "of". By curiosity I looked up "to" in Longman's DCE and was not astonished that they have not recognized this special use of "to" although they have differentiated 22 numbers.
Some examples I would put in the box of "to, expressing belonging to" 1 the keys to this car 2 the top to this pen 3 She has a mean side to her. 4 There is a a very moral tone to this novel. 5 There is a funny side to everything.