Jesus addressed God in prayer characteristically as His Father. He spoke as though the raising of Lazarus was something that the Father had already decreed, which was true (cf. John 11:11). His prayer was not a request for Lazarus" resurrection. Such a prayer would have glorified the Father. It was rather a prayer of thanksgiving for what the Father would shortly do. It had the effect of focusing attention on the Son as God"s agent in performing the miracle. Jesus" prayer had the effect also of drawing the onlookers into His intimate relationship with the Father and proving that He really did do nothing independently of the Father (cf. John 5:19-47). [source][source][source]
Jesus" public prayer here is a good reminder that all leaders in public prayer should take those present into account when they pray. We should do so not by "playing to the gallery" (cf. Matthew 6:5) but by voicing prayers that are appropriate in view of who is present. [source][source][source]