For example, differentiation by itself is just pushing symbols around according to some arbitrary-seeming rules. It's not until I did physics that its purpose made sense. I studied calculus for years, and it never "clicked" for me, and I forgot most of it promptly. Then in just a semester of physics where I was applying it in the context of complicated problems, it suddenly felt like second-nature. I had to basically re-learn all of it from scratch, but with the context of my physics problems it was so easy!
I've had similar experiences teaching programming to junior staff. Anything you talk about in isolation goes in one ear and out the other. They have to encounter the problem in something larger that they are solving for the solution to make sense and motivate them to learn.
An example is string-escaping. E.g.: how do you represent the quote symbol in a quoted string? This seems trivial, but it trips up everyone when they are getting started. I mean literally everyone. So okay, I make sure to cover it in like... lesson #1 or #2 because string literals are everywhere, and escaping is common. Every single time, the people that sat through that lesson will ask me a week later to help me fix as program that has a literal like 'O'Brian' in it, and they can't figure out why it's broken. But once I show them that they should have used 'O''Brian' or 'O\'Brian', it all makes sense to them and they memorise the technique.
That book was totally great. Even if you got lost in the math reading the last formal part you understood what was going on.
"Here's what we're aiming for, and here's why it matters" should be the introduction, setting the scene and establishing the flow, but then you introduce the various blocks-that-will-be-built and start working up to them in the stepped fashion.
Trying to think of a good example reminds me of a puzzle game; and how sometimes the contrived puzzles in such games can be obtuse or phrased poorly because they really don't want to give away the answer.
The example should start with an unsolvable problem, then simplify aspects to make it more of an estimation model; which is a useful skill as well.