On your first question:
Teams are in the bonus (or the penalty) when they’ve committed 5 fouls as a team for the quarter. You’ll sometimes hear the term “zero fouls to give” or “no more fouls to give” from commentators. That just means the next foul is going to lead to free throws.
There’s a bit of a rule change though in the last 2 minutes of every quarter. In the last 2 minutes, if a team isn’t in the penalty, the 2nd team foul immediately puts teams in the penalty. You’ll hear the term “they have a foul to give” meaning that first foul won’t send the other team to the line but also, that the second foul will.
Offensive fouls, as far as I know, don’t count towards team fouls. So even when you’re at the limit, you’re not sending anybody to the line for charging through them. You’re also not counting offensive fouls to the 5 team fouls it takes to get to the penalty.
However, loose ball fouls could seem like offensive fouls I guess? For example, shot goes up. It misses. During the fight for the rebound, the team on offense fouls another player. This leads to free throws. This is because technically, the ball is in neither team’s possession. So it’s not an offensive foul per se but it does look it.