From my understanding it’s a characteristic you’re born with. Your environment can either push you further into it or pull you out of it to some degree.
You can also choose to appear more or less social, but it’s probably very difficult to change it at a core level.
Someone can appear very social and even become the “life of the party,” yet still feel very drained after socializing. This is by definition still an introvert
Others may be more reserved but feel recharged after social interaction. This is by definition still an extrovert
Because of this, it can be difficult to tell someone’s true nature, as we often learn to mask it.