It all started around the time of the New Deal.
Up until then, black Americans were voting primarily for conservatives and Republicans. The black populations is a very conservative, religious one to begin with, and still is very much the same in those regards. But the New Deal changed that. They were staunchly anti-Union as well. Because at the time, unions were running ads, saying to pay your dues and support the union, so black people won't work at the same company as you, or so a black person cannot take your job etc.
The civil rights era as well. Because wile the vast majority of Republicans voted for it, something not so honorable on either side of the isle transpired. You see, most republicans opposed to it were saying things like "we've done enough for blacks" and the Democratic party, despite being notoriously racist through the 19th century, and for the most part remaining so, passed a lot of legislation to acquire votes from the black community (which weren't really helping black communities, more over it was making them dependent on government). That and LBJ did an excellent job of selling the civil rights act, and making it noted as a purely democratic effort (which is still the position of many today). These events led to the black population voting primarily democratic and liberal. In fact, LBJ was quoted as saying something not too polite about black people on the passage of the civil rights bill, but he mentioned of how they would be voting for democrats for the next two centuries due to his efforts.
The Hispanic population has a totally different story. And almost to ambiguous to tell really. Anyway, Ill just say that many immigrants from Latin American countries and their descendants who fled communist countries, in particular Cuba, tend to vote conservative, and Generally have no trouble participating and integrating into American society. People from Mexico and other countries who fled from poverty stricken regions tend to vote democrat for the benefits the party aims to promise them.
Asians, or at least the ones I have spoken to are not liberal people, and rarely vote democrat. This is just my observation, and it may be different elsewhere. But they are actually usually conservative voters.
Indians (not American Indians) I am unaware of their affiliations. I do not know any Indian folks or their ideological stances because I've not met any or looked into it.
Arabs tend to vote democratic (or at least did for a time) because the GOP went crazy post 9/11, and yeah, I can see why they wouldn't.