An electronic document management system (EDMS) is used to store and manage electronic documents. An electronic records management system (ERMS) is more comprehensive and is  used to manage records throughout their lifecycle. Electronic records include not just documents but also emails, images, social media posts, and more.
In short, EDMS is focused on document storage and management. Meanwhile, ERMS has more advanced features for managing records, which can include documents.