Plugins are basically .NET assemblies where we can write custom logic that we want to register in Dynamics 365 CE for specific events. Every plugin is associated with an event. You can view all the predefined plugin events for Dynamics 365 CE at https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/supported-messages-entities-plugin or you can create your own custom events using actions in Dynamics 365 CE.
You can find out more about actions at https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/actions.
Once the development of our assembly is complete, we need to register it in Dynamics 365 CE. When registering our plugin for Dynamics 365 CE, we need to specify the execution stage. These execution stages identify whether our custom logic will run before or after Dynamics 365 CE's main database...