How the brain chooses to hold or loose its connections?

How the brain chooses to hold or loose its connections?