There are many theories for how a PokeBall works, which impacts how it is made:
MY PERSONAL FAVORITE is the Ideal Habitat theory. This theory states that the Pokemon is shrunk and put inside the PokeBall. The PokeBall then recreates what it imagines to be an Ideal Habitat for the Pokemon. For example, Water type Pokemon would have an ocean environment. This would explain the different types of balls- Repeat Balls work well on Pokemon the Trainer has already caught because it gathers information on the, let's say, Magikarp, so that the PokeBall 'knows' what the Magikarp would like, thus it recreates the perfect environment for the Magikarp so it will want to stay inside the ball. Love Balls create a dreamy, romantic environment, and Dive Balls show ocean environments that the Pokemon would want to stay in. Luxury Balls show the Pokemon a beautiful, luxurious environment. However, some balls, like the Quick Ball and Timer Ball, are not really explained that well in this theory.
Another theory sparks from a scene in the anime where Iris' Dragonite is shown inside a blue background, supposedly trapped inside a circle. This implies that Pokemon are perhaps 'shrunk' to fit inside the PokeBall. But the anime isn't really the best place for Pokemon information sometimes.
Then there's the theory that Pokemon are converted into red light particles, hence why a glowing red light appears when Pokemon return to PokeBalls or are launched out of them. But again, this only is a theory because the anime shows it that way, not actually in game. Maybe the anime just needed a smooth transitioning method for Pokemon to come out of their balls.
In short, there are a lot of theories. My personal favorite is the Ideal Habitat, but we might never know for sure.
But then the red light particles theory finds new light in the fact that you can transfer Pokemon to PCs. Maybe the light particles move towards the PC, then form the Pokemon inside? This one's a little Farfetch'd, but it's the only explanation I can think of.