We improve the performance of the Perfectly Matched Layer (PML) by using an automatic hp-adaptive discretization. By means of hp-adaptivity, we obtain a sequence of discrete solutions that converges exponentially to the continuum solution. Asymptotically, we thus recover the property of the PML of having a zero reflection coefficient for all angles of incidence and all frequencies on the continuum level. This allows us to minimize the reflections from the discrete PML to an arbitrary level of accuracy while retaining optimal computational efficiency. Since our hp-adaptive scheme is automatic, no interaction with the user is required. This renders tedious parameter tuning of the PML obsolete. We demonstrate the improvement of the PML performance by hp-adaptivity through numerical results for acoustic, elastodynamic, and electromagnetic wave-propagation problems in the frequency domain and in different systems of coordinates.