A wavefunction is a mathematical function that describes the quantum state of a particle or system of particles. It contains all the information about the system and determines the probabilities of finding particles in various positions and states when a measurement is made. In the quantum mechanical model, the wavefunction is fundamental to understanding how electrons behave within an atom.