@Subramanyam k Thanks for reaching out.
Office 365 groups are mainly used when you need to perform collaboration activities with people inside or outside the organization. They can get a shared group email and workspaces for sharing files, events and conversations.
You can read more about them here
Security Groups are used for granting permission to access the office 365 resources like sharepoint etc.
You can read more about it here.
You can also have a look at this 3rd party blog where they try to explain the differences with scenarios.
You can add a Service principal to a security group just by adding a member and typing the service principal name.
-----------------------------------------------------------------------------------------------------------------
If the suggested response helped you resolve your issue, please do not forget to accept the response as Answer and "Up-Vote" for the answer that helped you for benefit of the community.