This work is part of the Gaia Data Processing and Analysis Consortium papers published with the Gaia Early Data Release 3 (EDR3). It is one of the demonstration papers aiming to highlight the improvements and quality of the newly published data by applying them to a scientific case. We use the Gaia EDR3 data to study the structure and kinematics of the Magellanic Clouds. The large distance to the Clouds is a challenge for the Gaia astrometry. The Clouds lie at the very limits of the usability of the Gaia data, which makes the Clouds an excellent case study for evaluating the quality and properties of the Gaia data. The basis of our work are two samples selected to provide a representation as clean as possible of the stars of the Large Magellanic Cloud (LMC) and the Small Magellanic Cloud (SMC). The selection used criteria based on position, parallax, and proper motions to remove foreground contamination from the Milky Way, and allowed the separation of the stars of both Clouds. From these two samples we defined a series of subsamples based on cuts in the colour-magnitude diagram; these subsamples were used to select stars in a common evolutionary phase and can also be used as approximate proxies of a selection by age. We compared the Gaia Data Release 2 (DR2) and Gaia EDR3 performances in the study of the Magellanic Clouds and show the clear improvements in precision and accuracy in the new release. We also show that the systematics still present in the data make the determination of the 3D geometry of the LMC a difficult endeavour; this is at the very limit of the usefulness of the Gaia EDR3 astrometry, but it may become feasible with the use of additional external data. We derive radial and tangential velocity maps and global profiles for the LMC for the several subsamples we defined. To our knowledge, this is the first time that the two planar components of the ordered and random motions are derived for multiple stellar evolutionary phases in a galactic disc outside the Milky Way, showing the differences between younger and older phases. We also analyse the spatial structure and motions in the central region, the bar, and the disc, providing new insights into features and kinematics. Finally, we show that the Gaia EDR3 data allows clearly resolving the Magellanic Bridge, and we trace the density and velocity flow of the stars from the SMC towards the LMC not only globally, but also separately for young and evolved populations. This allows us to confirm an evolved population in the Bridge that is slightly shift from the younger population. Additionally, we were able to study the outskirts of both Magellanic Clouds, in which we detected some well-known features and indications of new ones.