There's no way to know if prayer actually resulted in a positive outcome or not, but I guess it is comforting to pray and things end up working out.