You may want to read this post for an explanation on MAF sensors:
How to test the MAFs yourself and How MAFs work - The Unofficial BMW M5 Messageboard (m5board.com)
The e39 predates the e53 but I suspect much of the same engineering principles apply to both. In a nutshell, the engine computer can estimate the air flow from the other sensors so if your MAF sensor is shot, the estimate will be better than the shot readings hence better performance. You can also try cleaning them but this is, apparently, only a temporary solution.