Broker Consulting interview question

How does Spring manage transactions behind the scenes? How would you manage it manually? (Follow-up: Using EntityManager with a try-catch block for commit/rollback)