From what I've read, the fighting was done, keeping in mind strategic interests. Unlike today's times when nations are usually at peace with each other and they have to declare war, during the early centuries of Islam, these were the times when various world empires used to remain in a state of perpetual war and the uncommon state was to declare peace (completely in contradiction to today's times). Empires used to continuously expand and contract as their power grew or waned. Caliph Abu Bakr, in order to keep the Islamic lands safe from the two surrounding empires captured some areas to create a kind of buffer zones. The Romans were already at war with the Muslims. Regarding the Persians, some traditions tell us that Khosrou of Persia had ordered to arrest Prophet Muhammad, but for some reason it did not happen. In any case, open fighting with the Persians had not started, but it is extremely likely that they would have started it when their internal political disputes got resolved and Muslims became a threat. After all, they had been fighting with the Romans for decades, they had no reason to spare the Muslims (whom they in their arrogance did not believe worthy) and every reason to attack to gain power and wealth (the objectives of those times). After Abu Bakr's action, the Persians started raiding those lands. This led one thing to another and resulted in all-out war between the Muslims, Romans and Persians.