There is a history of anti-Chinese sentiment in Indonesia, but even taking that into consideration, the violence of 1998 was unusually extreme and virulent, attributed to the encouragement of the army and the Suharto regime.
Jemma Purdey's Anti-Chinese Violence in Indonesia, 1996–1999 (2006) examines large-scale violence of the kind exemplfieid by the 1998 riots.
First, economically successful migrant minorities are often resented by the local indigenous majority: the experience of the Chinese in southeast Asia has been compared to that of Jews in Europe, South Asians in East Africa, and even Koreans in American inner cities. Family-based investment networks, business savvy, and overseas connections— and laws against land ownership and participation in certain industries— led ethnic Chinese to dominate a few industries and to control a disproportionate amount of the economy; a 1995 survey found that despite being only 3% of Indonesia's population, they controlled 73% of its publicly listed companies (though not 80% of its economy as was sometimes reported).
Second, as many as a third of ethnic Chinese are Christian and many others are Buddhist or Confucian, while the remainder of the country is overwhelmingly Muslim. So even though they have lived in Indonesia for hundreds of years, many in the majority view them as outsiders and with suspicion.
Third, hatred against the Chinese was long cultivated. The VOC had actively recruited Chinese middlemen during the sugar boom of the early 18th century; after Chinese mill workers rioted over wages in 1740, however, they were massacred and subjected to discriminatory laws for the remainder of the colonial period. Like any successful minority, they are a convenient scapegoat and distraction for governments.
As the Suharto regime was consolidating its power in the 1960s, many generals and officials enacted discriminatory measures against the Chinese such as forcing them to register for deportation and banning the Chinese language and encouraging ethnic Chinese to take Indonesian names. Ironically, fear of communist China spurred mistrust of the successfully capitalist Chinese-Indonesians as well. At the same time, while most Chinese-Indonesians were small business owners such as shopkeepers, a few politically connected figures had a high profile (the cukong system). Resentment againts the nepotism and corruption of the Suharto years thus merged with resentment against Chinese economic success.
So, in the population at large there was a great deal of ignorance/fear about and resentment of the peranakan Chinese, and there are frequent incidents of anti-Chinese violence into the 1990s. When the 1997 Asian financial crisis hit, the Indonesian economy went into a tailspin as the rupiah collapsed and austerity measures imposed by the IMF sent commodity prices, including food, soaring, spurring more hatred of traders and financiers among whom the Chinese were disproportionately represented.
But Purdey argues further that the 1998 Jakarta riots were systematic, not spontaneous. For example, rape gangs were clearly seeking out Chinese women, but rape had not been a feature of earlier violence; rather, it implicated the military, whose repressions in Aceh and East Timor had also been marked with rape, a link later confirmed Another study found that violence began simultaneously in different parts of Jakarta (and against Buddhist populations), unlike most riots which ripple out from a single point, suggesting they were at least partially orchestrated.