When performed within the context of Islamic jihad warfare, the ghazw's [Arab style warfare -b]
function was to weaken the enemy's defenses in preparation for his eventual conquest and subjugation. Because the typical ghazw raiding party often did not have the size or strength to seize military or territorial objectives, this usually meant sudden attacks on weakly defended targets (e.g. villages) with the intent of terrorizing/demoralizing their inhabitants
and destroying material which could support the enemy's military forces. Though rules of war in Islam's rules of warfare offered protection to non-combatants such as women, monastics and peasants (in that, generally speaking, they could not be slain), their property could still be looted or destroyed
, and they themselves could be abducted and enslaved
(Cambridge History of Islam, p. 269):
The only way of avoiding the onslaughts of the ghāzīs was to become subjects of the Islamic state
. Non-Muslims could then enjoy the status of dhimmīs, living under its protection. Most Christian sources confuse these two stages in the Ottoman conquests. The Ottomans, however, were careful to abide by these rules... Faced with the terrifying onslaught of the ghāzīs, the population living outside the confines of the empire, in the 'abode of war', often renounced the ineffective protection of Christian states, and sought refuge in subjection to the Ottoman empire. Peasants in open country in particular lost nothing by this change.
Cambridge History of Islam, p. 285
A good source on the conduct of the traditional ghazw raid are the medieval Islamic jurists, whose discussions as to which conduct is allowed and which is forbidden in the course of warfare reveal some of the practices of this institution. One such source is Averroes' Bidāyat al-Mujtahid wa-Nihāyat al-Muqtasid (translated in Peters, Jihad in Classical and Modern Islam: A Reader, Chapter 4).