By surface analysis, loll(“laze, hang loose”) + y + pop(“shot, try, burst, enter”); likely through lolly(“head, tongue”).[1] Attested from 1784. Compare lollygag and lollypoop.
An unlikely derivation is from Romaniloli(“red”) + phabaj(“apple”); candy apples are often red and placed on a stick to keep the person's hands dry, similar to lollipops. However candy apples were not well-known until a century after the first known use of the word lollipop, and the original lollipop was likely a small item like modern penny candy.
1993, Laura S. Frost, “Conjugative Pili and Pilus-Specific Phages”, in D.B. Clewell, editor, Bacterial Conjugation, Springer, →DOI, →ISBN, page 209:
The gene III proteins appear as five lollipops protruding from the end of the phage, and these “balls” can be removed by treatment of the phage with subtilisin, rendering the phage noninfectious.
2010, Renaud Le Goix, Delphine Callen, “Production and Social Sustainability of Private Enclaves in Suburban Landscapes”, in Samer Bagaeen, Ola Uduku, editors, Gated Communities: Social Sustainability in Contemporary and Historical Gated Developments[1], Earthscan, →ISBN, page 107:
The reasons for this containment of gated communities and private streets are not to be sought in morphology (suburban residential developments with lollipops and dead ends are common in France), but rather in local practices by residents.
2019, Joe Baur, Best Hikes Cleveland: The Greatest Views, Wildlife, and Forest Strolls (Best Hikes Near Series), Rowman & Littlefield, →ISBN, page 43:
Mount Pleasant itself is a lollipop trail. Walking along the handle of the lollipop is a breeze—the perfect warm-up for the uphill climb at the beginning of the loop.
(motor racing) A sign on a stick held in front of the vehicle during a pit stop.