The implication is that each of the disks functions sort of like a "how to" DVD. You watch the video, as it demonstrates the technique for doing the move, and you follow along. It's the same idea as some of those exercise tapes or YouTube tutorials.
But this is all inference. This is never stated in any of the games, and to my knowledge TMs and HMs do not exist in the anime. It also doesn't explain how, in older generations, the TM would be consumed on being used to teach it's move to a Pokemon, something that is simply nonsensical with the DVD theory (though this concern is moot now, because TMs are no longer consumed and HMs are no longer HMs).
In the end, it's probably one of those things that nobody really knows, not even the people at GameFreak who made the game.
TMs do make an appearance in Pokemon Origins, but they are never actually shown being used/taught