A structural theory of mutualistic networks