Without exploring all the details of the code above the mle definition, it looks like fisher.test is solving an equation for the odds based on theoretical assumptions defined in mnhyper (another function defined in fisher.test[1]) and not calculating it directly from the data. I suspect if I wanted to get a full answer, I would need to read the references in ?fisher.test

[1] There are several functions in fisher.test such as dnhyper, mnhyper, and pnhyper which appear to be distribution functions for a non-central hypergeometric distribution.