Doesn't always happen that way. All it took for David, a man after God's own heart, was to see Bathsheba bathing on the roof.
I'm not arguing for it, I'm just saying it happens and it can be forgiven.
There are still consequences. David and Bathsheba's first son paid for it with his life, and his kingdom was rent by another of his son's rebelliousness.