Talking in your sleep occurs in some people may be because of stress, anxiety, having less sleep, unresolved issues, eating in excess exactly before going to bed or it can be due to some unfinished task that has remained in our subconscious.
People talk in their sleep because of the day that they have had or the hard life that they lead on a regular basis. Things like not enough rest, anxiety, or there is a conflict in their life that hasn't been resolved. In research it shows that people who don't speak their mind and just sit and watch. That is really not a good thing to do. So while they are sleep the words they have been wanting to say seep out of their minds into reality.