How does Escrow service functions?

How will it ensure that the money either would be paid or rolled back in any case of fraud?