>>49480697In the 90s lore-book, it explained Pokemon can't really force themselves to do it. The first recording of it was when they accidentally drugged a Primape to near-death and it automatically did it. Most people can't retract their balls into themselves, but if it's cold, they do it without control. The Pokeball just does something that forces the Pokemon's body to react; the same statement said they did a lot of other experiments and the Pokeball was just ultimately what worked best and they improved it's design with time.
Excluding the anime and manga making artistic adaptions (with minimal information to go by) we now know that the Pokeball forces the Pokemon's body to react and shrink, somehow forces the Pokemon into the ball, and makes it curl into a ball, almost fetus like; and acts as a kind of incubator. The Pokemon is completely aware of it's surroundings and can even force itself out of the ball if it so desires. So the issue is less the shrinking but how the Pokemon magically gets into the ball.