It is a semantic compound character, formed by combining 之 ("to go"), and 儿 ("person" or "legs of a person").
The meaning "first" comes from the idea of a person stepping ahead of others—i.e., moving forward before others.