I would divide those into two different categories.
1) Praying for the dead: The idea here is that not even the dead are beyond God's power and God's love. Possibly, the dead are even more directly in God's presence than are the living. So we ask for God to act in loving and healing ways toward his beloved children who have died.
2) Praying to saints, or asking for the saints to pray for us, is trickier ground. I've seen this done in ways that are uncomfortably close to polytheism for my tastes. Should I really ask St Joseph to help me sell my house? I dunno... But the positive idea is that the saints are in the presence of God, and might be asked to pray to God on our behalf, much as you might ask me (a living person) to pray to God on your behalf.
Indeed!