This study examines geodesics and plurisubharmonic envelopes within the Cegrell classes on bounded hyperconvex domains in $\mathbb{C}^n$. We establish that solutions possessing comparable singularities to the complex Monge-Amp\`ere equation are identical, affirmatively addressing a longstanding open question raised by Cegrell. This achievement furnishes the most general form of the Bedford-Taylor comparison principle within the Cegrell classes. Building on this foundational result, we explore plurisubharmonic geodesics, broadening the criteria for geodesic connectivity among plurisubharmonic functions with connectable boundary values. Our investigation also delves into the notion of rooftop envelopes, revealing that the rooftop equality condition and the idempotency conjecture are valid under substantially weaker conditions than previously established, a finding made possible by our proven uniqueness result. The paper concludes by discussing the core open problems within the Cegrell classes related to the complex Monge-Amp\`ere equation.