Scholars are split on what time frame Jesus has in mind here. Some believe what Jesus depicts here is a prophecy for the twelve apostles. In that case, the "they" referred to here would be Jewish religious leaders and those they influence. Those authority figures will persecute and murder Jesus' disciples (John 16:1–4). All nations—Israel, then Rome, and eventually countries beyond—will hate them because they are connected to the name of Jesus. It is certainly true that nearly all the Twelve were persecuted and killed for their association with Christ, as they refused to stop preaching the gospel of His kingdom.
Some believe the prior verses depict general history leading up to the events depicted in the book of Revelation.
Others see those troubles as part of the final seven years prior to Christ's millennial kingdom (Revelation 20:4), a period called the "tribulation." In most cases, those far-future-looking interpretations meet here. This verse is normally assumed to be a description of the actual "end times." The context of this line of thought ends with a specific statement "and then the end will come." That suggests Jesus means this segment to apply to the time immediately prior to His second coming (Revelation 19:11–15).
Preterism is the most foolish belief within Christianity. There are scholars who adhere to it, I've yet to see or hear a convincing defense of it. IMO, It's as heretical as replacement theology, you have to spiritualize almost all of prophecy to agree to those conclusions.
Jerusalem, "Gospel of the Kingdom" (biggest and most obvious clue to which period and to whom this refers, we currently do not preach the gospel of the Kingdom, we preach the gospel of Christ, or Paul's gospel as he referred to it; Jesus and John the Baptist were the last to preach the Kingdom message), fleeing on the Sabbath, Judaea, fleeing to the mountains, etc. Jewish warnings for Jewish people. Fleeing Jerusalem from the treachery of the anti-Christ wouldn't be an issue for any other group of people. Matt: 25 is a continuation of 24, and refers to the sheep and goats (judgment of how the gentiles living at the end of the trouble treated Israel).
Matt 24's structure mirrors Rev. 6, at the beginning. Wars, famine, pestilence, earthquakes, martyrdom, Jesus is specifically running through the Seal judgements of Revelation, line for line, the "beginning of sorrows", followed by the abomination of desolation, which Daniel tells us specifically will be at the midpoint of the 7 years. The chapter is a warning to unbelieving Jews what will happen to them during Daniel's 70th week.