The winner is the person what can make the best 5 card hand with there 2 hole cards and the 5 community cards what are on the table. Given the best 5 card hand you both can make is straight (34567) you will chop the pot.
If board was AQ753
You held A6
Opponent held A4
You win with AAQ76
And he loses with AAQ75
And if board here is 34567
You have 37
opponent has AQ
you have 34567
he has 34567
same hand so you both win.