We prove that the Hardy–Littlewood maximal operator M is bounded on the variable Lebesgue space \(L^{p(\cdot )}(X,d,\mu )\) , with \(1<p_-\le p_+<\infty \) , over an unbounded space of homogeneous type \((X,d,\mu )\) with a Borel-semiregular measure \(\mu \) , if and only if the averaging operators \(T_\mathcal {Q}\) are bounded on \(L^{p(\cdot )}(X,d,\mu )\) uniformly over all families \(\mathcal {Q}\) of pairwise disjoint “cubes” from a Hytönen–Kairema dyadic system on X. This extends Diening’s well-known characterization of the boundedness of M on \(L^{p(\cdot )}(\mathbb {R}^n)\) to the setting of spaces of homogeneous type, while also providing a slight refinement of the original result.