its only a matter of time

Its only a matter of time is another way of saying that something is sure to happen at some time in the future and is almost guaranteed to happen at some point. When you say a matter of time, it means at some time, even if the time isnt now or even in the near future. But by saying its only a matter of time, it is to mean that at some point in time this thing is going to happen.