  This article documents the muon reconstruction and identification efficiency
obtained by the ATLAS experiment for 139 fb$^{-1}$ 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\to\mu\mu$ and
$J/\psi\to\mu\mu$ 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|<2.7$.
