Why does that work?

If you think of each button press as a matrix being added to the board state where only the row and column are set to 1, along with the commutative nature of the moves (order doesn't matter), then as long as the total number of "flips" from the cumulative matrices of moves is odd, then it will reset the board.

Mathematically I might say that the system's precomputed solution vector is readily apparent.

I think this only works with an odd grid size. With an even grid size you might have to do it twice.

What if there was only one white block on the grid?

The game is initialized with a guaranteed solvable board:

https://github.com/RaymondTana/Lights_Out/blob/31fe5e866c45c...

I’m pretty sure this case is solvable too. Click the white block, then click all the blocks which turned white after that. This flips each block twice (bringing them back to their original state), except for the original white block which was only flipped once.