I'm using Amazon Linux AMI, which seems to be some RHEL or CentOS offshoot. I've read that it should be binary compatible with RHEL. My question is: is there any advantage to compile a package from source as opposed to using the RHEL or CentOS repos (as they should work too)?
In theory compiling your own source could take advantage of particular compiler optimizations that leverage your hardware. In practice for most applications it doesn't make a tangible difference - particularly when compared to the issues associated with dependencies, updates, testing, etc. This advantage also presupposes a compiler that can optimize for the features in question which is by no means a given.
There's a semi-famous quote by Donald Knuth:
"Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%."
At this point rolling your own binaries for the purposes of performance would definitely fall into this category. There are times when particular features that aren't in distributions might be needed (for example) but these cases should be few and far between.