The whole evening after their meal together, Jesus had been speaking to his disciples about these things, but what he had in mind varied, according to the context. For example, after he had washed his disciples’ feet (Judas Iscariot being still present) Jesus said he, their master or rabbi (teacher), had given them an example to follow (John 13:14-15), and if the servant isn’t greater than his master (teacher), then they should follow his example (John 13:16), and they’d be blessed in doing these things (John 13:17). A little later, these things pertained to a time when he would be in them, but he was telling them these things, while yet with them (John 14:18-25).
Still later, as they prepared to leave the upper room, Jesus explained to his disciples about abiding in them and they in him by giving them the example of the vine. Jesus was the vine and his disciples were the branches. If they made their abode in him, they would bear much fruit and therein the Father would be glorified. In that context, these things pertained to Jesus’ joy being in their bearing fruit and hoping that joy would remain in them, and likewise their joy would be fulfilling his joy, all going back to obeying him, imitating his example (John 15:5-11).
As Jesus continued, these things, took a surprising turn. They involve the fact that Jesus’ disciples would never have chosen him to be the Messiah. Their understanding of who the Messiah should be was so different from who he really is (John 15:16). Being the Messiah involves persecution and death, the giving of one’s life for one’s friend, and there is no greater love than this. Therefore, they were to love one another, as Jesus loved them (John 13:34; 15:12). So, if the servant isn’t greater than his master (John 13:16), and the Master, Jesus, had given them an example to follow (John 13:14-15), and, if indeed, he was in them (John 14:16-25) and they, like the branches of a vine, abide in him, they would bear fruit to the Father (John 15:5-11), but only if they continued to abide in him, the true vine (John 15:4-5).
Thus, the context of all these things is other worldly. That is, these things are not of this world (John 15:19). Therefore, the love that Jesus had for them, whom he referred to as his friends (John 15:13-14), and which they were to have for one another (John 15:17), was so unworldly, that the world would hate them, just as it hated Jesus (John 15:18). So, if the world persecuted Christ, it would also persecute them, for no other reason than the world doesn’t know the one who sent Jesus (John 15:20-21).
Therefore, in John 16:1 Jesus told his disciples that he was telling them these things, so they wouldn’t be offended (as Judas was offended) and apostatize (cp. Matthew 13:21), and betray one another out of fear (cp. Matthew 24:10), when these things occurred. If that weren’t enough, Jesus then added that the religious authorities would cast them out of the synagogues and would eventually believe killing them would serve God (John 16:2). Yet, that very service proved such folks had not known Jesus (the Messiah) and God (John 16:3; cp. John 13:34; 15:9).
Indeed, it is precisely because the religious authorities refused to know Jesus that they couldn’t know the Father (cp. John 1:10-11, 18; 8:19; 15:21, 23). Therefore, in order that Jesus’ disciples wouldn’t be offended (John 15:1), he told them these things, while he was yet with them (John 15:4). To be forewarned is to be forearmed. Therefore, none of these things would overtake them by surprise, because Jesus informed them, while he was still with them (cp. John 14:25).
Finally, Jesus said: “…these things I told you not from the beginning, because I was with you” (John 16:4), yet these things weren’t hidden from them. Jesus did inform them of trouble that would come upon them (Matthew 24:9; Luke 6:22), and he also alluded to his departure (Matthew 9:15). Nevertheless, in the context of the Olivet Discourse (Matthew 24) and the Sermon on the Mount (Luke 6), the disciples were willing to embrace the trouble, because they assumed they knew what it meant for Jesus to be the Messiah, and they were willing to fight and die for him (cp. John 13:37). However, when Jesus told them to lay down their arms (John 18:11), they became confused, not knowing in what context the Messiah saves. And, as far as Matthew 9:15 is concerned, it is presented in the context of a wedding. While the bride and groom pledge their love and faithfulness until death do them part, who really considers death or the parting of one or the other? The main consideration is the joy of being with one another – “because I was with you!” (John 16:4). Now, Jesus was parting, and going away, so they had to come to face the fact that these things had finally come upon them. They sorrowed now, but their sorrow would soon change to joy (John 16:20).