It means they are just alike, they're the same. I always took it as meaning best friends, close to each other emotionally, and that they deserve each other, but I don't know if it technically means any of that, haha.
This is a cute phrase. It's usually said in a slightly joking manner or at least a loving manner, if slightly exasperated. Like, "Sheesh, my two babies wore me out. But look at them sleeping in their crib now, exhausted after dirtying up the whole house together. They both even threw their mashed carrots at the same place on the wall! They're two peas in a pod." They don't have to look alike for this expression to apply. They just have to act alike, or be alike in some way. I believe it's said with some degree of pride.