STM in Frege uses transactional variables (TVars) to allow for safe parallel programming without locks. TVars can only be accessed inside atomic transactions that isolate work and retry as needed to ensure consistency. This avoids issues like deadlocks seen with manual locking. The purely functional Frege language provides additional safety through type checking and preventing side effects inside transactions. Examples shown include counters and an account transfer that compose transactions for modularity.