The tax number and the social-security number get mixed up constantly. Here is the difference, kept simple.
Your AFM marks your tax identity; your AMKA marks your place in the social-insurance and health system. Each comes from a separate authority and exists for a separate reason.
Anyone planning to work in Greece or use its health services will, in all likelihood, need to hold both.