Sukkah 41b says a person shouldn't hold certain things while praying shemoneh esrei:
א"ל מר בר אמימר לרב אשי אבא צלויי קא מצלי ביה מיתיבי לא יאחז אדם תפילין בידו וספר תורה בחיקו ויתפלל...ואמר שמואל סכין וקערה ככר ומעות הרי אלו כיוצא בהן התם לאו מצוה נינהו וטריד בהו הכא מצוה נינהו ולא טריד בהו
Mar bar Ameimar said to Rav Ashi: My father would pray with the four species in his hand in an expression of his love for the mitzva. The Gemara raises an objection: A person should not hold phylacteries in his hand or a Torah scroll in his lap and pray while doing so...And Shmuel said: With regard to a knife, a bowl full of food, a loaf of bread, or money, these items are similar to those mentioned above. Why, then, is that not the case with regard to lulav? The Gemara answers: There, in the cases listed above, they are not related to performance of a mitzva, and he is preoccupied with them (which distracts his focus from his prayers). Here, in the case of the four species, they are related to performance of a mitzva, so he is not preoccupied with them (in a manner that will distract him from his prayers).
Rashi explains since he is concerned lest these items fall from his hand, he is distracted and he unable to concentrate on his prayers.
This is codified in the Rambam, Hilchos Tefillah 5:5 and Shulchan Aruch 96:1. The Mechaber in Seif 2 adds that you can hold a prayer book since it is for the sake of the prayers.
My question is I occasionally see people holding their babies or little kids during prayers and I'm wondering if it's appropriate. The Mishnah Berurah in Seif Kattan 4 adds
וכתב בברכ"י דה"ה דאסור להושיב תינוק לפניו בשעת תפלה:
The Birkei Yosef writes that it is also prohibited to place a baby in front of you during prayers.
Now I could see a loose baby being more distracting than holding a baby, but a person is still concentrating to avoid dropping it. If it is a problem, I was wondering if these baby backpacks I've seen would be better (I suppose it would depend if a backpack is allowed).
Now there is the related point that often if the parent doesn't hold the child they'll start crying, which would be the highest distraction. Maybe it's allowed just like elsewhere where the MB says it's permissible to make gestures to a crying baby if it will help, even if it's normally prohibited, since the cries are distracting.