When Solomon finished building the temple, he prayed for God's blessing on the temple and on Israel. Solomon prayed that, if God sent Israel into exile, but they confessed their sin and repented, that God would hear their prayer and forgive them and cause their conquerors to show them mercy. (I Ki. 8:46-51) Israel sinned and went into captivity. (2 Ki. 25) Daniel, in captivity, prayed confessing and repenting on behalf of Israel. (Dan. 9) Cyrus, king of Persia, had mercy on the Israelites, and sent them home, led by Ezra. Cyrus gave back the articles Nebuchadnezzar, and instructed them to re-build the temple. (Ezra 1; 2 Chron. 36:22)
God moves Solomon to pray for something he would not answer for centuries. God answered the prayer completely.
He does not tell us why, but God has chosen in his good pleasure to work in answer to prayer, even to the point of putting the prayer in our hearts. So, not only is prayer a great privilege, but it is the manner in which God works. If God leads you to pray for something, do not refuse or neglect. Even if you have to stop doing something else at the time. God is working.
"The prayer of a righteous man is powerful and effective". (Jas. 5:16)