Thanks for your query at HCM.
Pea sized swelling behind the ear can be due to lymphnode enlargement.
Lymph node enlargement can occur because of infection or inflammation in ear or pharynx.
My recommendation would be get physically examined by ENT specialist
and if nothing significant important in examination you can go for Fine needle aspiration cytology of the swelling it will help in diagnosis,