There are basically three ways accompaniment can be expressed:
- The language has a special "comitative" case, which is used for accompaniment: Finnish ystävineen, "with some friends". (Note that in Finnish this case is extremely rare; you'll mostly see it in linguistics textbooks.)
- The language uses an adposition for accompaniment: Latin cum amīcīs, German mit Freunden. Here Latin uses the ablative and German uses the dative: not because there's anything inherently ablative or dative about accompaniment, but because that's the standard case for "object of a preposition that's not about movement". That's why you'll also see prō amīcīs and aus Freunden "for some friends", with the same cases but no accompaniment.
- The language used to have a specific comitative case, but it merged together with something else. This is what you find in Hungarian, where the comitative merged into the instrumental: barátokkal can now mean "along with some friends" or "by using some friends".
It sounds like you're most interested in the third possibility. The instrumental is the most common case for this, to the extent that Lakoff and Johnson claimed it was a linguistic universal that comitative and instrumental would look exactly the same (which it's not, at all—they focused too much on English).
But sometimes case mergers are just caused by phonological changes making two forms look the same (like later Latin's nominative-vocative, dative-accusative-ablative mergers), and when this happens, any case might get involved: it comes down to the phonology, not the semantics.
EDIT: Thanks to amegnunsen in the comments, there's a fourth option too, which I hadn't been familiar with!
- The language uses a conjunctive ("and") to mark accompaniment: Kabyle d kra imeddukal "and/with some friends".