Presidents have a major influence on what lawmakers do.
First, they're the ostensible leader of their party, and to the extent they actually can and do lead, they can influence the rest of the party, including the legislature.
Second, they can also greatly influence the relationship with the opposition party, as has been made eminently clear from the polarizing effect that Obama, Bush Jr, and Trump had on their opposition.
Third, they have one of the world's biggest megaphones that they can use to push for their agenda. Witness the galvanizing effect of Kennedy's call for a space race or the Peace Corps.
Fourth, they have veto power over legislation. While legislation can still pass over a Presidential veto, it has to have a lot more support in Congress, which means that controversial reforms will have a much harder time passing.
Fifth, they can sign executive orders, which (in lieu of legislation) can also have a great effect.