You can't say "у неё матери есть..." because "у неё" means 'she has'. It would be like saying "у меня матери есть...". On the other hand, if её is used to mean 'her x' as it is here, it does not gain the consonant н, which only appears when it functions as 'she' / the genitive form of она
I'm guessing that almost all (if not actually all) the times you hear the "У [а] есть [б]" construction, it will be about possessing something, not eating. So there's no worry about confusing the two, since the other one would never be said.
(By the by, what letters do Russians use most often as variables in algebra?)