What does a real estate attorney actually do?

A real estate attorney's primary role is to protect the legal interests of their client in a mortgage transaction.