How do you make these?

I wonder how to end the twisted cord so perfectly, it is not even noticable and does not fray at all? In most cases I've seen the cord remains on top of the fabric, so sewing it inside is not an option? Anybody has an experience to share? I'd be most welcoming!

I wonder how to end the twisted cord so perfectly, it is not even noticable and does not fray at all? In most cases I've seen the cord remains on top of the fabric, so sewing it inside is not an option? Anybody has an experience to share? I'd be most welcoming!