Required by rule: tracing the paths of "obligatory" and "mandatory"

What is similar?
Both words "obligatory" and "mandatory" describe something that is required or must be done. They both imply a lack of choice or option in completing the task or following the directive.
What is different?
"Obligatory" often relates to moral, social, or customary expectations and might suggest something commonly accepted or expected, while "mandatory" tends to refer to rules, laws, or official requirements that enforce compliance.
Which one is more common?

Examples of usage
Obligatory- Attendance at the meeting is obligatory.
- He failed to complete the obligatory steps in the process.
- Wearing a helmet is mandatory for safety reasons.
- The course includes mandatory training for all employees.