Yoniso Manasikara can be spoken of as giving attention based on a correct comprehension of the senses & what the senses present.
Samma Sati is a path-factor, it is a bearing in mind and is the opposite of obliviousness.
One can be distracted from Yoniso Manasika and switch to giving inappropriate attention due to being deficient in spiritual faculties ie lacking the power of concentration [non-distractedness]. At that point one is not bearing in mind the correct apprehension and is oblivious to the truth.
Alternatively or one can be deficient in wisdom and be unable to give appropriate attention due to that lack of understanding.
“From inappropriate attention
you’re being chewed by your thoughts.
Relinquishing what’s inappropriate,
Keeping your mind on the Teacher,
the Dhamma, the Saṅgha, your virtues,
you will arrive at joy,
rapture, pleasure without doubt.
Then, saturated with joy,
you will put an end to suffering & stress.” - SN 9.11
One can give an analogy of steering a ship.
One who is attentively keeping the ship on the right course is not oblivious [sati] to what needs to be given aporopriate attention and attends to it appropriately [yoniso manasikara] in order to keep on course.
Take an uneducated ordinary person who has not seen the noble ones, and is neither skilled nor trained in the teaching of the noble ones. They’ve not seen good persons, and are neither skilled nor trained in the teaching of the good persons. They don’t understand to which things they should pay attention and to which things they should not pay attention. So they pay attention to things they shouldn’t and don’t pay attention to things they should.
Because of paying attention to what they should not and not paying attention to what they should, unarisen defilements arise and arisen defilements grow.
But take an educated noble disciple who has seen the noble ones, and is skilled and trained in the teaching of the noble ones. They’ve seen good persons, and are skilled and trained in the teaching of the good persons. They understand to which things they should pay attention and to which things they should not pay attention. So they pay attention to things they should and don’t pay attention to things they shouldn’t.
Because of not paying attention to what they should not and paying attention to what they should, unarisen defilements don’t arise and arisen defilements are given up.
They properly attend: ‘This is suffering’ … ‘This is the origin of suffering’ … ‘This is the cessation of suffering’ … ‘This is the practice that leads to the cessation of suffering’. And as they do so, they give up three fetters: identity view, doubt, and misapprehension of precepts and observances. - MN 2
Misc on Sati;
Therein what is mindfulness-awakening-factor? Herein a monk is mindful, furnished with excellent mindfulness-penetration, he remembers, remembers constantly, what has long been done and long been said (concerning release). This is called mindfulness-awakening-factor. (1) - Vb 10
That which is mindfulness, recollection, recall, mindfulness, remembrance, bearing (in mind), not losing, not confusing, mindfulness, the Faculty of Mindfulness, the Strength of Mindfulness, Right Mindfulness: this is called ‘mindfulness.’ - Vb 7
The mindfulness which on that occasion is recollecting, calling back to mind; the mindfulness which is remembering, bearing in mind, the opposite of superficiality and of obliviousness; mindfulness as faculty, mindfulness as power, right mindfulness—this is the faculty of mindfulness that there then is. (abhihamma) - Ds 2.1.1
The Blessed One said, “Suppose, monks, that a large crowd of people comes thronging together, saying, ‘The beauty queen! The beauty queen!’ And suppose that the beauty queen is highly accomplished at singing & dancing, so that an even greater crowd comes thronging, saying, ‘The beauty queen is singing! The beauty queen is dancing!’ Then a man comes along, desiring life & shrinking from death, desiring pleasure & abhorring pain. They say to him, ‘Now look here, mister. You must take this bowl filled to the brim with oil and carry it on your head in between the great crowd & the beauty queen. A man with a raised sword will follow right behind you, and wherever you spill even a drop of oil, right there will he cut off your head.’ Now what do you think, monks: Will that man, not paying attention to the bowl of oil, let himself get distracted outside?”
“I have given you this parable to convey a meaning. The meaning is this: The bowl filled to the brim with oil stands for mindfulness immersed in the body. Thus you should train yourselves: ‘We will develop mindfulness immersed in the body. We will pursue it, hand it the reins and take it as a basis, give it a grounding, steady it, consolidate it, and undertake it well.’ That is how you should train yourselves.” - SN 47.20
Suppose, monk, that there were a royal frontier fortress with strong walls & ramparts and six gates. In it would be a wise, experienced, intelligent gatekeeper to keep out those he didn't know and to let in those he did. A swift pair of messengers, coming from the east, would say to the gatekeeper, 'Where, my good man, is the commander of this fortress?' He would say, 'There he is, sirs, sitting in the central square.' The swift pair of messengers, delivering their accurate report to the commander of the fortress, would then go back by the route by which they had come. Then a swift pair of messengers, coming from the west... the north... the south, would say to the gatekeeper, 'Where, my good man, is the commander of this fortress?' He would say, 'There he is, sirs, sitting in the central square.' The swift pair of messengers, delivering their accurate report to the commander of the fortress, would then go back by the route by which they had come.
"I have given you this simile, monk, to convey a message. The message is this: The fortress stands for this body — composed of four elements, born of mother & father, nourished with rice & barley gruel, subject to constant rubbing & abrasion, to breaking & falling apart. The six gates stand for the six internal sense media. The gatekeeper stands for mindfulness. The swift pair of messengers stands for tranquillity (samatha) and insight (vipassana). The commander of the fortress stands for consciousness. The central square stands for the four great elements: the earth-property, the liquid-property, the fire-property, & the wind-property. The accurate report stands for Unbinding (nibbana). The route by which they had come stands for the noble eightfold path: right view, right resolve, right speech, right action, right livelihood, right effort, right mindfulness, right concentration." - SN 35.204