In asynchronous communication how is the frequency same but clocks of both devices different?
In synchronous communication, one clock source is used for both transmitter and receiver, with designed propagation times so that transmitter and receiver phases are always correctly aligned.

In asynchronous communication, two independent clock sources of the same nominal frequency are used. The only requirement is that the frequencies be within a tolerance of each other, not that they are identical. For any one word, the phase will be relatively consistent, but it may change between words. It is up to the receiver to handle the changing phase shift, usually by over-sampling and deciding for each word where to put the sampling instant.