Entanglement is one of the most intriguing features of quantum mechanics. It is widely used in quantum communication and information processing and plays a key role in quantum computation. At the same time, entanglement is not fully understood. It is deeply rooted into the linearity of quantum theory and in the superposition principle and (for pure states) it is essentially related to the impossibility of factorizing the state of the total system in terms of states of its constituents. The characterization and quantification of entanglement is an open and challenging problem. One can give a good definition of bipartite entanglement in terms of the von Neumann entropy or the entanglement of formation. The problem of defining multipartite entanglement is more difficult and no unique definition exists. We introduce the notion of maximally multipartite entangled states (MMES) of n qubits as a generalization of the bipartite case. The bipartite entanglement of a MMES is almost independent of the bipartition and is maximal for all possible bipartitions. Some examples of MMES for few qubits are investigated. For a larger number of qubits the search for MMES becomes more involved and unearths the presence of frustration. MMEs are the solution of an optimization problem that can be recast in terms of classical statistical mechanics. We focus on fundamental issues and possible applications (quantum teamwork).