"Hun skriver ti bøger sammen med sin ven."
Translation:She writes ten books together with her friend.
In that sentence the focus is set on doing something together (sammen med) instead of just doing something with someone. (med)
Language wise it is of course possible to just say med without the sammen.