ona vs. ni

From sona pona, the Toki Pona wiki

The pronouns ona and ni are used differently depending on context and is sometimes misunderstood by learners. The word ona is a third-person pronoun. It can contain the information about a content phrase. While ni is a demonstrative pronoun, similar to English's this / that.

mi kepeken ilo   ona li pona

mi kepeken ilo. ona li pona.

I'm using a tool. It [the tool] is good.

jan [ale luka uta] li moku e kili ona

jan Alu li moku e kili ona.

Someone is eating their [Alu's] fruit.

kasi mute li lon   ona laso li pona

kasi mute li lon. ona laso li pona.

There are many plants. The blue ones [plants] are good.

Besides being able to contain the information of a noun phrase, the pronoun ni may also hold the information of an entire sentence. Not only that, the information that ni contains can come after it is said:

mi kepeken ilo  ni li pona 

mi kepeken ilo. ni li pona.

I'm using a tool. This [using a tool] is good.

Note that when ona is used, the phrase ijo ni can be used instead, with ijo being substituted with any content word:

mi moku e kili  ona li pona 

mi moku e kili. ona li pona.

I eat a fruit. It [the fruit] is good.

mi moku e kili  kili ni li pona 

mi moku e kili. kili ni li pona.

I eat a fruit. This fruit is good.

Notice in the first example of each (mi kepeken ilo), how substituting ona for ni changes the meaning of the second part. For example, compare the following sentences:

mi wile ala moku e kili ona 

mi wile ala moku e kili ona.

I don't want to eat her fruit.

mi wile ala moku e kili ni 

mi wile ala moku e kili ni.

I don't want to eat this fruit.

mi sona e toki mute   ona li pona

mi sona e toki mute. ona li pona.

I know many languages. They [the languages] are good.

mi sona e toki mute   ni li pona

mi sona e toki mute. ni li pona.

I know many languages. This [knowing many languages] is good.