The answer is very goal dependent.
Personally, I train with both and teach clients on both. It’s beneficial to be able to push / pull / drag / squat our own body around in a variety of directions, but we also have to lift and move groceries, children, household items.
A functional body can do both, so should be trained doing both.
Both are effective for gaining over all strength. There is not one exercise solely for strength, solely for endurance etc. It is all in how you train. Typical science shows: 3-5 reps for strength, 8-12 reps for hypertrophy and 12+ reps for endurance. Your body can and will react differently to those exact numbers and it is up to you to decide what is working better.
The key to strength training, like with all forms of training is still going to be your caloric intake. You cannot expect to gain strength when you are too depleted on your calories. So make sure those are in check and in line with your goals.
If you want to stay more compound movements then stick with the bench press, the squat, the clean, and the dead lift for over all full body strength and hypertrophy gains.
The main key in increasing strength is increasing the resistance at which the exercise is performed. For example… if you can do 5 reps at 100lbs on bench then you should increase to 105 (or whatever you are comfortable with) and do 3 reps. Then once you are capable of doing 5 reps with that then increase. I am using this as an example, the reps and weight you use will be different.
The point is, however, you cannot expect to gain strength without pushing yourself, adding resistance, and keeping your calories high enough to fuel your progress.