On the odd occassion in battle, you will notice various things in the background, ranging from trees in the field to rock formations in caves. These seemingly inocuous background objects do have a specific function, they can be destroyed
There are various factors involved in obtaining these items. It seems that specific ranged attacks work for each one. While Surf may work on one, it won't work on another nor will other moves such as Earthquake.
You can destroy certain objects in the backround of the battlefield, and you can receive items this way. To destroy the scenery, you need to use specific moves in specific spots.
There is a chart in the source on this.
Hope I helped!
Edit: I tested using Air Cutter on green trees on route 5. I tried 10 times, and succesfully hit the tree, and got a berry ten times.This means that as long as you use the correct move, you will always receive an aftermath item. These background items do not always appear however, and when they do it is always on a platform behind the opposing Pokemon.