This article documents the muon reconstruction and identification efficiency obtained by the ATLAS experiment for 139 \hbox {fb}^{-1}fb of pp collision data at \sqrt{s} =13 TeV collected between 2015 and 2018 during Run 2 of the LHC. The increased instantaneous luminosity delivered by the LHC over this period required a reoptimisation of the criteria for the identification of prompt muons. Improved and newly developed algorithms were deployed to preserve high muon identification efficiency with a low misidentification rate and good momentum resolution. The availability of large samples of Z\rightarrow \mu \muZ→μμ and J/\psi \rightarrow \mu \muJ/ψ→μμ decays, and the minimisation of systematic uncertainties, allows the efficiencies of criteria for muon identification, primary vertex association, and isolation to be measured with an accuracy at the per-mille level in the bulk of the phase space, and up to the percent level in complex kinematic configurations. Excellent performance is achieved over a range of transverse momenta from 3 GeV to several hundred GeV, and across the full muon detector acceptance of |\eta |&lt;2.7∣η∣&lt;2.7.