Jesus prayed because we don't belong to this way of thinking and acting, but he also knew that we would always be influenced by what was going on around us. Jesus prayed that his joy would be complete in the disciples. Happiness comes when our needs are met and there is no pain. Joy is what comes when we believe and are convinced of who we are in the eyes of God and the special place we have both in this world and in the eyes of God. But Jesus also knew that we would seek happiness and sometimes miss the more important gift he wanted for us, joy.
Happiness can come and go.
Joy can be with us always. Jesus had done all that he could do. He had risen and shared time and meals and conversations with the disciples. Now as he prepares to leave, he prays. I am sure that Jesus knew exactly what he wanted to pray.