Yes that is a draw: there is no series of legal moves leading to checkmate.
What if the only legal move was checkmate but you lose on time?

no, its not a draw. as martin says black has sufficient mating material, so white loses if they run out of time.
no, its not a draw. as martin says black has sufficient mating material, so white loses if they run out of time.
Depends on the rule set. At Chess.com it would be a loss (it checks to see if the material is enough to win against a bare King and K+R+N can beat a bare King). Under International (FIDE) or US rules it would be a draw because there is no way for Black to win in any sequence of legal moves and White cannot even play a legal move to try to win after the flag has been called.
PS there have been a number of similar threads but they generally end up buried and not readily accessible, so they periodically pop up again.
This thread
https://www.chess.com/forum/view/more-puzzles/my-favorite-simple-chess-puzzle-few-pieces-hard-puzzle
points to the applicable FIDE and US rules.

thats weird. but black could win under a certain sequence of moves in that position, provided white doesn't play the very best move every time.
thats weird. but black could win under a certain sequence of moves in that position, provided white doesn't play the very best move every time.
The OP gave an example where the only legal move the flagging player had was delivering checkmate (loss on Chess.com and draw in FIDE or US with the flagging player getting a loss because Chess.com does not look at the flagging player's other pieces). The link gave an example where the flagging player was facing a forced checkmate (K+N mating K+P) and wanted to flag to avoid it (draw on Chess.com because it doesn't look at the flagging player's other pieces and loss in FIDE or US). Another example of draw vs loss is White Ke1, Pa4, Pc4, Pe4, Pg4 vs Black Ke8, Pa5, Pc5, Pe5, Pg5 where it is impossible for any Pawn to be taken or for either King to reach the opponent's Pawns. That can be called an immediate draw by FIDE or US or called a draw after a player flags. On Chess.com a flagging player loses (K+4P can beat K and it ignores the flagging player's four Pawns that make checkmate impossible for either side).

But there is also possibility of illegal move in FIDE OTB, so it can also be lost by 2 illegal moves, but as illegal moves are not possible on chess.com, it must be a win, but why it's not like this
But there is also possibility of illegal move in FIDE OTB, so it can also be lost by 2 illegal moves, but as illegal moves are not possible on chess.com, it must be a win, but why it's not like this
FIDE (and US) prohibits depending on illegal moves for post-flagging analysis and during play the standard rules for both (yes, even the US though most organizers us a variation) are that the arbiter/TD can call the illegal moves and require them to be corrected. Otherwise you can have a player saying that a person answering a ringing phone can lose regardless of position and thus a lone King should be able to win on time because the opponent might get handed a phone that rings and that the opponent answers.

But there is also possibility of illegal move in FIDE OTB, so it can also be lost by 2 illegal moves, but as illegal moves are not possible on chess.com, it must be a win, but why it's not like this
FIDE (and US) prohibits depending on illegal moves for post-flagging analysis and during play the standard rules for both (yes, even the US though most organizers us a variation) are that the arbiter/TD can call the illegal moves and require them to be corrected. Otherwise you can have a player saying that a person answering a ringing phone can lose regardless of position and thus a lone King should be able to win on time because the opponent might get handed a phone that rings and that the opponent answers.
I don't get anything what you said, but I guess illegal moves moves are not considered if you lose on time, otherwise there will be no insufficient material thing.
Here? You lose if your opponent has sufficient mating material. In your example position the opponent does.
For FIDE, that would be a draw, since mate is not possible by any series of legal moves.