I'll try my best to explain it. This will likely get long winded, there is a lot to say about it, so I apologize in advance.
For starters, lets identify the specific components of a turbocharger. The turbo has 2 housings, 2 wheels, and a common shaft. The housing and wheel on the exhaust side is called the turbine. The housing and wheel on the intake is called the compressor.
A turbocharger creates air flow by placing the turbine housing and wheel in the exhaust gasses. That placement creates restriction/pressure in the exhaust housing which causes the turbine wheel to spin. The turbine wheel is connected to a shaft and that shaft is also connected to a compressor wheel. So if the turbine wheel is spinning, the compressor wheel spins, creating air flow and pressure on the intake side of the engine.
Both turbine and compressor wheels/housings have a specific pressure/flow relationship. Turbo manufacturers have charts or "maps" that show this and you can see an example of those on the right side of the page here.
Garrett Turbo GT3782
I'm going to refer to this turbo specifically throughout this post.
Here is it's compressor map
You can see on that compressor map the rpm and efficiency of the compressor at various air flows and pressure ratios.
On the bottom of the graph shows the air flow. Air flow is based off of engine displacement and rpm. Larger engines flow more air, and running the engine at a higher rpm flows more air.
The left side of the graph shows the pressure ratio. That is the pressure difference between the air going into and out of the turbo. So if you're at sea level where you have 14.7 psi of atmosphere pressure, and you have 14.7 lbs of boost, you have a 2.0 pressure ratio.
The different efficiencies are the ovals or "islands" on the graph, and the wheel rpm is labeled to the right of all the islands and shows wheel speed lines crossing the islands.
What you do is find the specific air flow and boost pressures and plot that point on the graph and you can see how efficient the compressor you're using is. For example, if your engine is ingesting air at 35 lbs/min air flow and has a 2.2 pressure ratio, the compressor wheel is spinning around 89,959 rpm and is on the 78% efficiency island.
That shows that for that specific point in time, you chose the correct wheel and housing for what you're currently doing.
Now, if you raise the rpm, you change the air flow, and put the point at a different location on the chart, which changes the compressor efficiency. Changing the boost pressure will also do the same thing.
So, OEM's will take all the different air flow and pressure points, put them on a chart, and then find a turbo whose compressor map lays over all the dots the best. They do this for each engine and power rating.
Every compressor wheel and housing out there will have a different graph showing it's air flow/pressure/efficiency/rpm relationship. So there are thousands of these maps out there to cover all the different engine options out there.
Now, lets move onto the exhaust side and look at the map for the turbine wheel/housing.
Like the compressor chart, it shows the relationship between pressure and air flow. So that when a specific amount of air is going through it, it creates a specific amount of back pressure. You need some pressure in the exhaust to get the wheel to spin, and without pressure it won't do that. You can see in the graph, it really won't flow more then 32 lbs/min. So trying to force more air through it will only create more exhaust back pressure, which isn't good. Too much exhaust back pressure can ruin an engine.
So, like the compressor, you plot the different air flow data points from the engine, and put them on the turbine housing chart. You then pick a turbine wheel and housing that best lines up with the data points you have. You have to run a housing that flows just enough to keep the back pressure down. Running too large of a turbine will create a slower turbine rpm, where too small of a turbine will create too much back pressure and too fast of a turbine rpm. Like compressors, turbines also have different graphs for each wheel and housing, so you have many different options to choose from.
Now, what you may realize, is that it's hard to pick a turbine housing that covers all your data points the engine runs at, and that's where waste gates and variable geometry turbo chargers come into play.
What those do, is modulate the exhaust housing pressure. So you can run a smaller turbine, which allows the wheel and shaft to get up to speed quickly at your lower engine revs, but then bypass the extra air flow you'd have at higher rpm, eliminating any excessive exhaust pressure. This allows a turbo to work over a very broad rpm range.
Now, here's some things to note.
With all the testing, computers, and technology available now a days, turbo manufacturers have created better turbine and compressor designs. In doing so, a design from 1990 might only have a peak efficiency of 75%, whereas a design from 2010 could achieve a peak efficiency higher then that, or have larger islands on the graph. This is also where your billet wheel options, like the "wicked wheel" for example, can come into play as they are an upgraded design installed on older turbos.
Another thing that some gloss over, and it's a pet peeve of mine, is that the turbine wheel and shaft spins 100k+ rpm. I think it's imperative to have the whole assembly balanced, and that installing a new wheel changes that balance and requires the whole thing to need re-balanced. I know some companies say it isn't necessary, but I disagree.
Another thing I see stated, and you didn't say it, but I'm going to address it because a lot of people do, is thinking that a turbo is all free power. It's not "free" power by any means, because it creates back pressure in the exhaust that the piston has to push against. But with that backpressure, it also creates boost, and boost is more air for the engine to ingest that it wouldn't normally have done so naturally aspirated.