Born with it ...
Males are born with highly variable length of their foreskin
covering glans penis.
After birth, physical growth along with the process of desqaumation between glans penis and foreskin gradually makes foreskin retract to eventually expose the glans penis completely for some, partially for most, but still leave tight and long, even non-retractable foreskin for few. So, phimosis is an inborn disorder