The sun also has a major impact, but due to it’s distance from earth, the moon is the stronger of the two influencers on tides. The interaction of the Sun and Moon and the changing angles create changes in the tidal bulges.
According to the NOAA article, where much of this information is taken from, the rhythm of the tides change throughout the year due to the changing position of the earth in relation to the sun.
When the Sun and Moon are in alignment (at the Full and New Moons) the solar tide has an additive effect on the lunar tide, creating extra-high tides and very low tides, (called Spring Tides) then a week later, when the Sun and Moon are at right angles (known as “squares” in astrology) the solar tide partially cancels out the lunar tides, which moderates everything (known as Neap Tides). During each month, there are two sets of Spring Tides (astrological “opposition” and “conjunction”, Full and New Moon respectively) and two sets of Neap Tides (astrological “squares” corresponding to First Quarter and Last Quarter Moons).
Then, there’s also the moon’s elliptical path around the Earth, which creates a changing distance between them.
Once a month, when the moon is closest to the Earth (at perigee) the tide forces are higher, then two weeks later, when the moon is farthest from the Earth (at apogee), the lunar tide forces are less and the tidal forces are less than average.
There is a lot more science involved in understanding the forces of the tides and the moon, but I think this gives a good overview of how the whole thing works…