Having some speed on the bases helps as well. Personally I've found that my most efficient lineups (runs scored with relation to team OPS) tend to have a very good, traditional leadoff hitter (i.e. Tim Raines, Max Carey, Rickey Henderson, Lou Brock, etc). And if there's some okay speed throughout the rest of the lineup, you'll score more runs than if you had a lineup with a better OPS, but slow baserunners that won't steal bases and won't score on those singles and doubles.
And I do believe there is some 'chemistry' involved and where the player(s) are put in the lineup. If you have a some high OBP players with not much speed in the lineup and then put a low AVG hitter who strikes out a lot behind them because they have a high SLG (and OPS), that may end up being a disaster compared to putting a higher AVG hitter that doesn't strike out a lot, but has a lower SLG %.
There's also little things to look out for such as your team can be a good offense, but grounds into double plays a ton and you may want to either be more aggressive on the baserunning or more aggressive with hit and runs.