Freemasonry is a secret society whose secrets are available in any large library. Exposures began almost as soon as the Grand Lodge did. Masonry Dissected appeared in 1730, Three Distinct Knocks in 1760, Jachin and Boaz in 1762, and Duncan's Ritual, still the standard American reference, in 1866. Grand Lodges have published their own ritual books. Anyone who wants to read the ceremonies can.
What is actually withheld is narrower than the reputation suggests: the modes of recognition, and the experience of undergoing the ceremony without knowing what comes next. The obligations a candidate takes are about not disclosing those, and the fearsome penalties attached to them have been symbolic for a long time and are omitted outright in many jurisdictions.
The structure is simple. Three degrees, Entered Apprentice, Fellow Craft and Master Mason, are worked in a lodge, and the third contains the drama of Hiram Abiff, the architect murdered rather than reveal what he knows and then raised. Everything above the third degree, the Scottish Rite's thirty-three and the York Rite bodies, is additional and confers no authority over a craft lodge, whatever the numbering implies.
The persistent question is not what happens in lodge but what membership did outside it. Historians of the eighteenth century treat the lodges as a genuinely new civic form, where men of different rank and confession met under rules of their own making, and read that as more consequential than any ritual.