This depends on the field. What I get sent as a peer reviewer is generally in pretty good shape already, and the author has simply missed a relevant publication here or there, or got a factoid wrong. So, the paper was already nearly publishable as it was, and it didn’t take me more than a few minutes really to make it even better. Often my work in these cases is its own reward.
I actually got sent my first outright awful paper recently, and there wasn’t in the end much of an onus on me. The flaws of the paper were so blatant that I could simply tell the editor that the entire premise was unsound without having to go into much detail, and the editor understood.