Okay, the following is the opinions of Jeffery, take it for what it is worth.
In Mathew 18:18-20 It says, "I tell you the truth, whatever you bind on earth will be  bound in heaven, and whatever you loose on earth will be  loosed in heaven.
“Again, I tell you that if two of you on earth agree about anything you ask for, it will be done for you by my Father in heaven.
For where two or three come together in my name, there am I with them.”
From this I believe that 18:19 is what the OP was talking about. It says that if two on earth agree about anything you ask for then it will be done by God. 18:20 is the verse that was posted by LongHorn, I believe.
On the surface this seems like a lot of cool power. “Hey my wife and I agree that we should have a mansion and lots of money and stuff, so God will do it huh?” But if you read the preceding verses, it talks about if your brother sins against you what you should do. First go to them and discuss it directly and alone. If he refuses take along one or two others to be witnesses, if he still does not fess up, then take it to the church. The it goes into the next verses talking about the power of the two.
I believe this is partly based on the laws of the time having to have a certain number of witnesses to try a crime. If you are the only accuser of your brother, then there is not really any punishment, if there are others to substantiate it, then action can be taken.
As for why should God require prayer. Prayer is not a system to get things you want. Prayer is talking to God. It is how we get to know God. If you never talked to your parents how would they know who you are. Sure God knows everthing so he knows what you need, but you do not know him very well, if you do not talk to him. It seems that people believe that since God is all powerful, then he does not have any feelings. He does not hurt, or feel joy. I believe that he does have feelings. It hurts him when his creation denies him. When they act like God does not exist. If you were a parent and your child denied you, would you not hurt? Sure you would still love them, but if they do not accept your help what can you do?
Let’s say your child committed a crime and is jailed. Now you as a parent do not want to see your child suffer, so you try to get them out of jail. The jailer comes to you and says you are free to go, your parents have paid your bail. If the child says, “I do not believe that they are my parents and I do not accept their help.” Will the jailer take the child out and send them on their way? I believe that the jailer would say “OK, stay here then.” That is what happens with God. He offers everyone their freedom, but some choose to stay locked up in sin, yes he could force you because he is God, but he does not go against you choice.
He sometimes does give something to someone who did not ask. Sometimes he does not give something to someone who does ask.
Jesus should be the model for all Christians. When Jesus prayed in the garden, He did not want to die for people as yet unborn. He would rather have done it another way. But he told God, not my will but yours be done. When people pray for something and add if it be your will, they are expressing their unworthiness. They are letting God know that they would like for something to take place, but if that is not God’s will then they are stating upfront that they will not quit believing in him due to it. God answers all prayers from believers, but sometimes he says “No”.
Just my thoughts.