Research has suggested that compulsive behavior persists because

There is some underlying conflict

It reduces anxiety

It diverts the attention of the individual from the problem

Others begin to expect it