Set the two kings up facing each other on e4 and e8 with a white rook on e1 behind them, and it looks as though the white king is doing the attacking. It is not. The king on e4 attacks exactly eight squares, d3 to f5, and e8 is not one of them. What it is doing is blocking its own rook.
e Step aside and the check appears. That is a discovered check, and the king is allowed to be the piece that does the discovering.
Why the kings can never touch
A king may not move to a square attacked by an enemy piece, and a king attacks the eight squares around it, so the square beside a king is permanently off limits. The two kings always have at least one square between them. Since attacking a piece means being able to move to its square, and a king can never move to a square next to the other king, a king can never attack the other king. The kings cannot stand next to each other and, by the same rule, a king can never capture a king.
Notice this is not a special anti-king clause. It is the ordinary rule about kings and attacked squares, applied twice.
The check a king can give
The discovered version is real chess, not a curiosity, and it wins material because the piece that moves is unaccountable for one move.
e The knight has to be undefended for the king to take it, because a king may never capture a defended piece. Any other piece doing the uncovering has no such problem: it can grab something defended and walk away, since the check has to be answered first. This is also why active kings win rook endings. A king sitting in front of its own rook on an open file is not wasted: the moment it steps aside, the check arrives free.
The same trick belongs to every piece, not just the king, and it is one of the most common ways games are decided at club level. There is a page of discovered attack puzzles if you want to see it in positions with the pieces still on, and what check is covers double check, the version where the moving piece gives check too.