Legislators are elected by citizens to act as their representatives, doing the work of researching and making choices and voting on behalf of those citizens. However, the citizens who make up the general population have many different viewpoints and experiences and concerns, as do organizations and groups that become involved in trying to shape governmental decisions and policies. Legislators base their votes upon the viewpoint expressed by the groups and/or individuals who elected them to office.
If different legislators answer to sectors of the population which have different agendas, they will be voting on different sides of an issue. If legislators can negotiate a compromise, that means they have each given away some of their priorities for a piece of legislation in order to create a meeting point that is acceptable to all sides. When legislators are unwilling to change their viewpoint because of their beliefs or due to pressure exerted by the people or groups that elected them, they vote based on that stand - and the progress of the bill through Congress may become blocked when neither side has enough votes to advance the bill.