A very ancient surname, infrequent and widely spread across Spain, mostly in Madrid, Barcelona, Ciudad Real, Valencia, Cuenca, Sevilla and Toledo; and also in Pontevedra, Lugo, Guadalajara, Almería, Granada, Alicante and Málaga.
It is much more common on its plural form: Mejías.
It comes from an ancient personal hispanic name from a questionable etimology, possibly a variant of Matías. On the other hand, it also means medicine, so maybe it comes from nicknames applied to pharmaceuticals.