PIM is Product Information Management while MDM is Master Data Management.
At a high level, the main difference between the two is that PIM is focused on product data while MDM is focused on master data. Master data is defined as the consistent and uniform data that provides the core information about an organization's customers, products, suppliers, employees, etc.
PIM systems are used to manage product data and information, whereas MDMs are used to manage, cleanse, govern, and consolidate master data from multiple sources.
PIM systems typically have features to support things like product catalog management, product enrichment, and digital asset management, whereas MDM systems will support data quality, data governance, data integration, data security, and data cleansing.
Both PIM and MDM can be used to support omnichannel commerce initiatives, but PIM is more focused on the product data aspect while MDM is more focused on the master data aspect.