It implies a forceful and sometimes aggressive approach to getting people to work together.
Here are some examples:
* "The boss told us to knock our heads together and come up with a new marketing plan."
* "I think it's time we all knocked our heads together and figured out how to solve this problem."
It's important to note that this idiom is often used in a humorous or informal context, and it doesn't always have to imply anger or aggression.