An idea to create this is to use 3 grids with different xstep and ystep. Then, to automate the process, I can use a pic. More on pic on this answer of mine
You can toy around with the pic, create arguments to change it or use pic actions to transfer arguments to subparts of the pic code.
\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[
threegrids/.pic ={
\draw[ystep=5cm,xstep=1cm,color=gray] (0,0) grid (5,5);
\draw[ystep=5cm,xstep=5cm,color=gray] (5,0) grid (10,5);
\draw[ystep=5cm,xstep=1cm,color=gray] (10,0) grid (15,5);
\node at(7.5,2.5) {...};
}
]
\draw[ystep=5cm,xstep=1cm,color=gray] (0,0) grid (5,5);
\draw[ystep=5cm,xstep=5cm,color=gray] (5,0) grid (10,5);
\draw[ystep=5cm,xstep=1cm,color=gray] (10,0) grid (15,5);
% add the dots
\node at(7.5,2.5) {...};
% using a pic
\pic at (0,-6) {threegrids};
\end{tikzpicture}
\end{document}

\draw[color=gray] (0,0) grid[xstep=.5cm, ystep=4cm] (10,4);? – Rmano Jun 21 '23 at 13:52