If the sender and the reply-to field are different which email gets the bounce back message?
Neither. It's the envelope From field – i.e. the SMTP MAIL FROM:<…> command – that defines this.
(Though as to how your system chooses which envelope-From address to send... I'm guessing it would, by default, copy it from the "From:" header, but usually it's changeable separately.)
For example, a SMTP conversation might look like this:
$ swaks --h-From noreply@example.com --to grawity@gmail.com
=== Trying gmail-smtp-in.l.google.com:25...
=== Connected to gmail-smtp-in.l.google.com.
<- 220 mx.google.com ESMTP th5si9071845wjc.89 - gsmtp
-> EHLO kremvax.example.com
<- 250-mx.google.com at your service, [193.219.181.217]
<- 250-SIZE 157286400
<- 250 STARTTLS
-> MAIL FROM:<grawity@kremvax.example.com>
<- 250 2.1.0 OK th5si9071845wjc.89 - gsmtp
-> RCPT TO:<grawity@gmail.com>
<- 250 2.1.5 OK th5si9071845wjc.89 - gsmtp
-> DATA
<- 354 Start mail input; end with <CRLF>.<CRLF>
-> Date: Thu, 05 May 2016 07:36:36 +0300
-> To: grawity@gmail.com
-> From: noreply@example.com
-> Subject: test Thu, 05 May 2016 07:36:36 +0300
-> X-Mailer: swaks v20130209.0 jetmore.org/john/code/swaks/
->
-> This is a test mailing
->
-> .
<- 250 2.0.0 OK 1462422997 th5si9071845wjc.89 - gsmtp
-> QUIT
<- 221 2.0.0 closing connection th5si9071845wjc.89 - gsmtp
=== Connection closed with remote host.
Here, the "envelope-From" address is grawity@kremvax.example.com, but I've manually specified the actual message's "From:" header to show something else. (If I wanted to set both at once, I'd use --from.)
Bounces themselves, I believe, are sent with MAIL FROM:<> to prevent further responses.
By the way, "From:" isn't always the sender – there's in fact a "Sender:" header as well.