Imagine a small character riding a panther. The panther runs 15m and the rider shoots an arrow at a target or uses a lance to hit a target 10m away. The panther moves another 5m and pounces.
RAW, this can only happen with a readied action and an independent mount. If the panther is controlled by the character, the panther is unable to take actions other than Dash, Disengage, or Dodge. (PHB 198) We'll assume that the mounted character spent their last turn readying some sort of attack, and has not otherwise spent their reaction this round. We'll also assume that the last 5 feet are in the same direction as the first 15.
Given those two assumptions, the panther would be able to trigger Pounce so long as it uses its action to make a claw attack on a target. It has moved 20 feet in a straight line towards the target and made a claw attack. Should the attack hit, the target would have to make a save to avoid being knocked prone and subject to a bonus bite attack. Any reactions or actions taken by other creatures or characters have no impact on whether the panther has fulfilled the requirements to Pounce.
For the case of a Beastmaster's beast being ridden by the Beastmaster, my first instinct would be that the creature is considered a controlled mount, but the final decision would be of course, up to the DM. If the DM were to rule that the beast counts as an independent mount, the Ranger would need the Extra Attack feature in order to attack and command an attack of their beast companion, since they both act on the same beat of initiative.