The IMF originates on the Sun, linked to the sunspots, and its field lines (lines of force) are dragged out by the solar wind. That alone would tend to line them up in the Sun-Earth direction, but the rotation of the Sun angles them at Earth by about 45 degrees forming a spiral in the ecliptic plane), known as the Parker spiral. The field lines passing Earth are therefore usually linked to those near the western edge ("limb") of the visible Sun at any time.