When you come across a portal you will want to hack it. Hacking portals is one of the primary ways to get items. In one hack attempt you may get 3-4 items or you may get nothing. As you approach your target touch your screen and you can select Target.
Once you are within range the scanner will open to the portal’s display. Then you can select hack portal. You will earn 100 points for hacking an enemy portal, but no points for hacking a portal in your faction’s control or a neutral portal.
Higher level portals often yield higher level items. BUT… They are also more likely to be defended with a shield where the portal can defend itself and drain your XM energy. Remember it takes XM Energy to be able to perform actions like Hack. If you lose all of your XM Energy you will not be able to do anything until you recoup it.