How does "buying out" of teaching work?
It strongly depends on the country and/or institution. To give an example: In the Netherlands, an Assistant Professor usually has a 60% teaching load and 40% research time (i.e., they are spending 3 days on teaching and 2 days on research - of course, this is somewhat blurred in daily life). If you bring in a major grant, you might use some of the money to buy off teaching time, so that you basically pay yourself 30% of your salary in order to arrive at 30% teaching, 40% 'old' research time, 30% additional reasearch time.

The department then basically has to hire someone else to take over the teaching duties you bought off.