The properties of acidic and alkaline solutions come from the ions they contain. An acid in solution, meaning dissolved in water, is a source of hydrogen ions, H+. For example, hydrochloric acid in solution releases H+ ions and chloride ions: HCl → H+ + Cl-.
An alkali in solution is a source of hydroxide ions, OH-. Sodium hydroxide dissolves in water and releases sodium ions and OH- ions: NaOH → Na+ + OH-.
So the key idea is simple. Acidic solutions contain extra hydrogen ions and alkaline solutions contain extra hydroxide ions. The ions are only released when the substance is dissolved in water.