The smallest controllable portion of a digital image, a pixel is a square or non-square image element, like a piece in a mosaic. A megapixel (MP) comprises 1,000,000 pixels, and the number of megapixels offered by a camera system represents the amount of information that it can deliver into a digital photograph or video.
More megapixels translate into a more accurate representation of the elements framed in a photograph. Yet, although the prevailing notion may be that the more megapixels you can get, the better, it's essential to keep in mind that more megapixels represent a bulkier file, which will take more resources for storage, transfer, as well as for image processing. Often, a user may opt to generate photos with a resolution lower than the maximum number of megapixels that their digital camera can offer (be it a smartphone or a separate camera system), since that may save space and facilitate editing.
When considering the number of megapixels, you must factor in your resources and your objectives: is it just an image for Instagram? Or will it be used professionally, perhaps even displayed on a billboard? Each purpose will translate into different requirements, and other determinants, such as pixel density, need to be taken into account.
The age of smartphone photography was inaugurated almost twenty years ago. Back then, selfies weren't a "thing," and a VGA camera with 0.3 megapixels was all one could dream of. Since then, the initially sad amount of megapixels has grown into an average of 11.9MP for smartphones.
It has become hard to keep up with the pace of smartphone photography: our phones are now equipped with fancy sensors, professional photography features, and even several lenses for each camera system (primary and front). And what's more, you can already choose a phone with a total amount of 76 megapixels – the Xiaomi Mi 9, whose three cameras pack 48, 16, and 12 megapixels, respectively.