Hi, I'm confused about IOs and POs.

As I understood, IOs answer the question "to whom or for whom" and stands between the verb and the DO. The following examples confuse me because the IOs are preceded by a preposition and have no direct object.

a. He has separated [from his wife.]
In my opinion [from his wife] is a PO because I don't see anywhere a DO but am I right?

b. All the credit for this belongs [to our sales staff.]
I don't understand the function of [to our sales staff]. It answers the question "to whom" so it looks like an IO but it already has the preposition "to" making me think that it's in fact a PO.

c. He lectures [to the students] [on drama].
Since 'to' is a preposition but [to the students] answers to the question 'to whom'. I don't understand why it's different from [on drama] which is a PO.

Please help me.