Beating of a carpet with a stick; makes the carpet come in motion suddenly,
while dust particles trapped within the pores of carpet have tendency to remain in rest, and in order to maintain the position of rest they come out of carpet.
This happens because of the application of Newton’s First Law of Motion which states that any object remains in its state unless any external force is applied over it.