Thanks for the posts everyone, learn a lot from this.
So if I understand correctly it works like this.
the higher the transaction cost the faster the transaction will take place on the bitcoin network.
But how does it work with Ripple, because if I am not mistaken there are low transaction fees and the transactions take approx 15 minutes
sorry if i ask stupid questions

Transactions are instantaneous. The confirmation or the process to include your transactions into the blockchain takes much longer, at least an average of 10 minutes.
Miners mostly consider the fee rates to maximize the fees that they're able to collect within the block. For Bitcoin, this means calculating by vbyte instead of actual size. Older clients still adheres to the 1MB real size limit. Using the vbyte as a metric allows the witness stripped block to be kept within that. While fee rate is generally how miner decides to include your transactions, they can choose some other factors as well, be it their own transactions or transactions that were directly pushed to them for an additional fee.
Certain altcoins are perceived to have faster confirmation due to the quicker block time or less congested network.