In the Sun-centred frame of reference, the pull of the Sun is effectively the same on both Earth and Moon, and they can be described as both orbiting the Sun in a series of scalloped curves, while in the Earth-centred frame, both are orbiting around their common barycentre, as others have explained in reply to other questions. At this distance from the Sun, the tidal pull of the Moon at the Earth's surface is approximately 2.17 times the Sun's, which is why lunar tides in the ocean are greater than solar ones. Solar tides are nevertheless significant: tides are higher when Sun and Moon are pulling in the same direction ('spring tides') and lowest when they act at right-angles ('neap tides').
As Isaac Newton demonstrated, the gravitational force between two bodies in space is proportional to the product of their masses, and inversely proportional to the distance between them. So that gravitational attraction could be changed only if one or both were to gain or lose mass, of if the average distance were to increase or decrease.