When it comes to having visible abs, getting lean and building muscle are both part of the equation. It's important to build up and strengthen your abdominal muscles, but then also have a relatively low amount of body fat to "reveal" them. Including general weight training and/or doing specific ab exercises, along with focusing on losing or maintaining weight (depending on your individual level of body fat) will help you to have good looking abs.
It's important to keep in mind that genetics play a role as well though. Some people store more or less of their body fat around their abdomen. Because of this, it may not be sustainable for everyone to have very defined abs all the time. A certain amount of fat on your body is necessary to feel good and stay healthy.