Words that can be used as prepositions take part in many idiomatic usages in English. That means that rational analysis won't tell you why they're used as they are; you just have to memorize these usages. First of all, as you noted, sometimes prepositions double up. For instance you can say
I went to the store with her
where with means accompanying, and you can say
He drove along the highway
where along means in a marked direction. But the two words can act as a unit (called a compound preposition):
I had to attend physics lectures along with laboratory sessions.
Here, along with means in addition to. But the two words don't always act as a unit. Take the sentence
She gets along with him.
In this case, the word along goes with the verb get to form what's called a phrasal verb. Get along means to have a good relationship. The sentence may be analyzed as
She (gets along) with him.
where the parenthesized words make up the verb, and with acts alone as a preposition. A further complication is that along may act as an adverb (i.e., as a modifier of a verb or adjective). For instance
He shuffled along with his head down.
In this case along is an adverb of manner, telling us how he shuffled, leaving with as the preposition.